<template>
  <div class="employ">
    <el-form ref="form" :model="form" label-width="85px">
      <el-row class="query-params">
          <el-form-item label="操作时间段" class="min-width">
            <el-date-picker
              v-model="form.starttime"
              type="date"
              placeholder="选择日期"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
            <span>~</span>
            <el-date-picker
              v-model="form.endtime"
              type="date"
              placeholder="选择日期"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="会员名称" class="query-input">
              <div class="input-wrap">
                <el-input v-model="form.nickname" placeholder="请输入会员名称"></el-input>
              </div>
          </el-form-item>
          <el-form-item label="手机号码" class="query-input" style="margin-right: auto;">
              <div class="input-wrap">
                <el-input v-model="form.telnum" placeholder="请输入手机号码"></el-input>
              </div>
          </el-form-item>
            <el-button type="primary" class="query-btn" @click="query">查询</el-button>
      </el-row>
    </el-form>
    <ul class="checkTab">
		<template v-for="item in tabs">
			<!-- 消息的气泡 -->
			<el-badge :value="totalNum" :max="99" :hidden="item.label != '待处理' || totalNum == 0" class="item">
				<li :key="item.status"
				  v-html="item.label"
				  :class="{'active': form.type === item.status}"
				  @click="clickTab(item)"
				></li>
			</el-badge>
		</template>
     
    </ul>
    <div v-loading="loading">
      <el-table :data="tableData" stripe style="width: 100%" size="small" border>
        <el-table-column label="会员名称" align="center">
          <template slot-scope="scope">
            <el-button
              @click="handleClickNickName(scope.row)"
              type="text"
              size="small"
            >{{scope.row.nickname}}</el-button>
          </template>
        </el-table-column>
        <el-table-column prop="telnum" label="手机号码" align="center"></el-table-column>
        <el-table-column prop="companyname" label="应聘企业名称" align="center">
          <template slot-scope="scope">
            <el-button
              @click="handleClickCompanyName(scope.row)"
              type="text"
              size="small"
            >{{scope.row.companyname}}</el-button>
          </template>
        </el-table-column>
        <el-table-column prop="positionname" label="面试岗位" align="center"></el-table-column>
        <el-table-column prop="interviewdate" label="面试时间" align="center"></el-table-column>
        <el-table-column v-if="form.type === '1'" prop="hrauditdate" label="操作时间" align="center"></el-table-column>
        <el-table-column v-else prop="platformauditdate" label="操作时间" align="center"></el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="140"
          align="center"
          v-if="form.type === '1' && (btnAuthority.syclBtn || btnAuthority.sysbBtn)"
        >
          <template slot-scope="scope">
            <div>
              <el-button
                @click="handleAabnormal(scope.row)"
                type="text"
                size="small"
                v-if="btnAuthority.syclBtn"
              >处理</el-button>
              <el-button
                @click="handleReport(scope.row)"
                type="text"
                size="small"
                v-if="btnAuthority.sysbBtn"
              >上报</el-button>
            </div>
          </template>
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="140"
          align="center"
          v-if="form.type === '2'"
        >
          <template slot-scope="scope">
            <el-button @click="handleClickDetails(scope.row)" type="text" size="small">详情</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div style="margin-top: 20px;">
        <el-pagination
          background
          :current-page="form.pagenum"
          :page-size="form.pagesize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          :page-sizes="[10, 20, 30, 50, 100]"
          @current-change="handleCurrentChange"
          @size-change="handleSizeChange"
        ></el-pagination>
      </div>
    </div>
    <el-dialog :visible.sync="dialogVisible" width="680px" @close="closeDialog">
      <div class="abnormal-dialog-header">
        <span>处理</span>
      </div>
      <div class="abnormal-detail-box">
        <div class="abnormal-detail-title">异常信息</div>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">会员名称:</span>
            <span class="col-value">{{abnormaldetail.nickname}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">电话号码:</span>
            <span class="col-value">{{abnormaldetail.telnum}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">面试企业:</span>
            <span class="col-value">{{abnormaldetail.companyname}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">面试岗位:</span>
            <span class="col-value">{{abnormaldetail.positionname}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">面试时间:</span>
            <span class="col-value">{{abnormaldetail.interviewdate}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">操作HR:</span>
            <span class="col-value">{{abnormaldetail.hrusername}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">操作时间:</span>
            <span class="col-value">{{abnormaldetail.hrauditdate}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">扣除积分:</span>
            <span class="col-value">{{abnormaldetail.interalnum}}</span>
          </el-col>
        </el-row>
      </div>
      <div class="abnormal-handle-box">
        <div class="abnormal-handle-title">扫码签到列表</div>
        <el-row class="abnormal-handle-row">
          <el-table
            ref="singleTable"
            :data="signTime"
            highlight-current-row
            @current-change="handleCurrentChange"
            style="width: 100%"
          >
            <el-table-column align="center" type="index" label="编号" width="150"></el-table-column>
            <el-table-column align="center" label="签到时间" type="index" width="450">
              <template slot-scope="scope">{{scope.row.insertTime}}</template>
            </el-table-column>
          </el-table>
        </el-row>
      </div>
      <div class="abnormal-handle-box">
        <div class="abnormal-handle-title">异常处理</div>
        <el-row class="abnormal-handle-row">
          <el-col :span="12">
            <!-- <el-checkbox v-model="params.checked">未爽约</el-checkbox> -->
             <el-radio-group v-model="params.type">
                <el-radio :label="1">爽约</el-radio>
                <el-radio :label="2">未爽约</el-radio>
              </el-radio-group>
          </el-col>
        </el-row>
        <!-- <el-row class="abnormal-handle-row">
          <el-col :span="12">
            <el-checkbox v-model="params.checked">爽约</el-checkbox>
          </el-col>
        </el-row> -->
        <el-row class="abnormal-handle-row">
          <el-col :span="16">
            <el-input v-model="params.note" placeholder="备注："></el-input>
          </el-col>
        </el-row>
        <div class="abnormal-dialog-btn">
          <el-button class="cancel-btn" @click="dialogVisible = false">取消</el-button>
          <el-button class="sure-btn" type="primary" :disabled="!params.type" @click="submit">确定</el-button>
        </div>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="dialogVisible1" width="1040px">
      <resume-detail
        v-if="dialogVisible1"
        :userid="userid"
        :nickName="nickName"
        :isShowTelphone="true"
      ></resume-detail>
    </el-dialog>
    <el-dialog :visible.sync="dialogVisible2" width="1040px">
      <company-detail
        v-if="dialogVisible2"
        :companyName="companyname"
        :companyId="companyid"
        :type="'0'"
        :tabNum="'4'"
      ></company-detail>
    </el-dialog>
    <el-dialog :visible.sync="dialogVisible3" width="680px" @close="closeDialog">
      <div class="abnormal-dialog-header">
        <span>详情</span>
      </div>
      <div class="abnormal-detail-box">
        <div class="abnormal-detail-title">异常信息</div>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">会员名称:</span>
            <span class="col-value">{{abnormaldetail.nickname}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">电话号码:</span>
            <span class="col-value">{{abnormaldetail.telnum}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">面试企业:</span>
            <span class="col-value">{{abnormaldetail.companyname}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">个人状态:</span>
            <span class="col-value">{{abnormaldetail.personalstatus}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">企业状态:</span>
            <span class="col-value">{{abnormaldetail.companystatus}}</span>
          </el-col>
        </el-row>
      </div>
      <div class="abnormal-handle-box">
        <div class="abnormal-handle-title">处理信息</div>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">处理结果:</span>
            <span class="col-value">{{abnormaldetail.jobstatus}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">处理人:</span>
            <span class="col-value">{{abnormaldetail.auditorname}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">处理时间:</span>
            <span class="col-value">{{abnormaldetail.platformauditdate}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name" style="min-width: 40px;">备注:</span>
            <span class="col-value">{{abnormaldetail.remark}}</span>
          </el-col>
        </el-row>
        <el-row class="abnormal-detail-row">
          <el-col :span="12">
            <span class="col-name">积分扣除对象:</span>
            <span class="col-value">{{abnormaldetail.usertype}}</span>
          </el-col>
          <el-col :span="12">
            <span class="col-name">扣除积分:</span>
            <span class="col-value">{{abnormaldetail.interalnum}}</span>
          </el-col>
        </el-row>
      </div>
    </el-dialog>
  </div>
</template>
<script src='./index.js'></script>
<style scoped src="./index.css"></style>
